package cn.wolfcode.wolf2w.web.controller;

import cn.wolfcode.wolf2w.domain.Banner;
import cn.wolfcode.wolf2w.service.IBannerService;
import cn.wolfcode.wolf2w.uitl.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/index/banners")
public class BannerController {
    @Autowired
    private IBannerService bannerService;
    @GetMapping("travel")
    public Object travels(){
        return JsonResult.success(bannerService.travelQuer(Banner.STATE_NORMAL,Banner.TYPE_TRAVEL));
    }
    @GetMapping("strategy")
    public Object strategys(){
        return JsonResult.success(bannerService.travelQuer(Banner.STATE_NORMAL,Banner.TYPE_STRATEGY).get(0));
    }
}
